<section class="title">
<?php if ($this->method == 'create'): ?>
	<?php $readonly = '';?>
	<h4><?php echo lang('escort_be_discount_type_add_title'); ?></h4>
<?php else: ?>
	<?php $readonly = 'readonly="readonly"';?>
	<h4><?php echo sprintf(lang('escort_be_discount_edit_title'), $discount->discount_code); ?></h4>
<?php endif; ?>
</section>

<section class="item">
	
<?php echo form_open(uri_string(), 'class="crud"'); ?>
<div class="form_inputs" id="news-form">

	<fieldset>
	
		<ul>
			<li class="even">
				<label for="discount_code"><?php echo lang('escort_be_discount_discount_code_label'); ?> <span>*</span></label>
				<div class="input"><?php echo form_input('discount_code', $discount->discount_code, 'maxlength="100" id="discount_code" '.$readonly); ?>
				<?php echo anchor('#', lang('escort_be_discount_auto_generate_label'), 'id="auto_generate"')?>
				</div>				
			</li>
			<li class="odd">
				<label for="discount_type"><?php echo lang('escort_be_discount_discount_type_label'); ?></label>
				<div class="input">					
					<?php echo form_dropdown('discount_type_code',  $discountTypeList, $discount->discount_type_code) ?>
				</div>
			</li>
			<li class="even">
				<label for="description"><?php echo lang('escort_be_discount_description_label'); ?></label>
				<div class="input">
					<?php echo form_textarea('description', $discount->description)?>
				</div>
			</li>
			<li class="even">
				<label for="active"><?php echo lang('escort_be_discount_active_label'); ?></label>
				<div class="input">
					<?php echo form_checkbox('active',1, $discount->active)?>
				</div>
			</li>
		</ul>
	</fieldset>
</div>
<div class="buttons float-right padding-top">
<?php $this->load->view('admin/partials/buttons', array('buttons' => array('save', 'save_exit', 'cancel'))); ?>
</div>
<?php echo form_close(); ?>
</section>